﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using NLBS.Data;
using NLBS.Entity;
using NLBS.Data.Business;

namespace NLBS.Control
{
    /// <summary>
    /// NLBS控件，用于显示日志分类下拉框
    /// </summary>
    public class CategoryDropDownList : DropDownList
    {


        public CategoryDropDownList()
        {
            IList<Category> list = CategoryData.GetCategoryList();
            //this.Items.Add(new ListItem("请选择", "-1"));
            foreach (Category cat in list)
            {
                ListItem item = new ListItem(cat.Name + "[" + cat.ArticleCount.ToString() + "]", cat.CategoryID.ToString());
                this.Items.Add(item);
            }
        }
    }
}
